from bs4 import BeautifulSoup as bs
import json
import requests
from urllib import request,parse
url_string = r'http://www.zuihaodaxue.cn/zuihaodaxuepaiming2018.html'
header= {
    'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64)',
    'Host':'www.zuihaodaxue.cn'
}
req = requests.get(url_string,headers=header)
soup=bs(req.content,'html.parser')
# list1=[]
# for item in soup.find_all('th'):
#     if item.string != None:
#         list1.append(item.string)
# for item in soup.find_all(id='select-indicator-type'):
#     for i in item.find_all('option',):
#         list1.append(i.string)
# print(list1)
list_all=[]
for item in soup.find_all('tr',class_='alt'):
    list_one = []
    for i in item.find_all('td'):
        list_one.append(i.string)
    list_all.append(list_one)
print(list_all)



# list_all=[]
# for item in soup.find(class_='hidden_zhpm'):
#     list_one = []
#     for i in item.find_all('td'):
#         list_one.append(i.string)
#     list_all.append(list_one)
# print(list_all)


# print(len(soup.find(class_='hidden_zhpm')))
# all = soup.find(class_='hidden_zhpm')
# list_all=[]
# list_all2=[]
# for i in all:
#     list_all.append(i)
# for m in list_all[1:601]:#特殊的地方在于  这个数据第一个有换行  最后三个数据为 换行  注释数据 换行
#     list_all1 = []
#     for i in m.find_all('td'):
#         list_all1.append(i.string)
#     list_all2.append(list_all1)
# print(list_all2)